﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using BlackBird.DataAccess;
using BlackBird.Models;

namespace BlackBird.Tests.DataAccess
{
    [TestClass]
    public class ShenheDataAccessTest
    {
        [TestMethod]
        public void CreateComments()
        {
            //For initializing users 
            //It may fail at "projects.ToList().ForEach(p => AllProjects.AllProjects.Add(BuildProject(p)));"
            //can comment it out to do the test
            GlobalObjectBuffer.Initialize();
            
            //comment1
            var comment = new CommentDM() 
            { 
                Content = "It's good!",
                UserName = "admin",
                Operation = ShenHeResult.Pass
            };

            ShenheDataAccess.SaveBijiadanSheheToDatabase(1, comment);

            //comment 2
            comment.Content = "I like it";
            comment.UserName = "aa";
            ShenheDataAccess.SaveBijiadanSheheToDatabase(1, comment);
        }

        [TestMethod]
        public void ReadComments()
        {
            var comments = ShenheDataAccess.GetBijiadanShenhe(1);
        }
    }
}
